package com.ddd.mill.domain.aggregate.constant.user.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author liu
 * @title: UserAppFromEnum
 * @projectName user-enterprise-center
 * @date 2020/11/2613:59
 */
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum  UserAppFromEnum {

    YYT_APP(0,"云印通APP"),
    YYT_MINI_PROGRAM(1,"云印通小程序"),
    YYT_CLIENT_WEB(2,"云印通客户web端"),
    YYT_OPERATION_WEB(3,"云印通运营web端"),
    ZTB_APP(4,"纸通宝APP"),
    ZTB_MINI_PROGRAM(5,"纸通宝小程序"),
    ZTB_OPERATION_WEB(6,"纸通宝运营web端");

    @EnumValue
    private final Integer value;
    private final String desc;

    UserAppFromEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    @JsonCreator
    public static UserAppFromEnum get(Integer value){
        for (UserAppFromEnum e : UserAppFromEnum.values()) {
            if (e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }
}
